import requests
import json

url = 'http://47.107.38.1/select'
# data = {'sql': """
#     SELECT t1.name,t1.code,t2.status,t2.follow FROM  stockbasic t1
#     LEFT JOIN  (select * from stockfollow e where e.userId=1)  t2 ON t1.code=t2.code
#     ORDER BY follow,name DESC
#     LIMIT 20 OFFSET 0
# """}
data = {'sql': """
    CREATE TABLE "etffollow" (
	"code"	TEXT NOT NULL, --编码
	"follow"	INTEGER,-- 是否关注
	"status"	INTEGER,-- 1->忽略 
	"userId"	INTEGER,-- 用户
    "id"	INTEGER NOT NULL UNIQUE,
	PRIMARY KEY("id" AUTOINCREMENT)
);
"""}

# stockfollow  etffollow
# data = {'sql': """
#     drop table "etffollow"
# """}

print("=============get================")
r =requests.get(url,data)
print(r.headers)
print(r)
print(r.text)
print(r.content)
